class X:
    name = "我是X类属性"

    def __init__(self):
        self.age = 18

    def a(self):
        print("我是实例方法a")

    @classmethod
    def b(cls):
        print("我是类方法b")

    def c(cls):
        print("我是类方法c1")


class Y:
    name2 = "我是Y类属性"

    def __init__(self):
        self.age = 18

    def a2(self):
        print("我是实例方法a2")

    @classmethod
    def b2(cls):
        print("我是类方法b2")

    def c(cls):
        print("我是类方法c2")


# class Y(X):
#     pass


class Z(X, Y):  # Z类继承X、Y类
    def c(self):
        print("我是实例方法c3")


z1 = Z()
print(z1.name)
print(z1.name2)
z1.a()
z1.a2()
z1.c()  # 优先使用前面父类的方法
print(Z.__mro__)  # 查看继承关系优先级
#
# (<class '__main__.Z'>, <class '__main__.X'>, <class '__main__.Y'>, <class 'object'>)

# y1=Y()
# print(y1.age)
# print(y1.name)

# y1.a()
# y1.b()


